

#include "acceptor.h"
#ifdef _WIN32
#include "acceptor_win.h"
#else
#include "acceptor_unix.h"
#endif


#include <memory>

using namespace as::snet;


Acceptor::Acceptor(std::shared_ptr<EventLoop> &ev)
{
    m_impl = std::make_unique<Acceptor::impl>(this, ev);
}

Acceptor::~Acceptor()
{

}

bool Acceptor::start(const EndPoint &ep)
{
    return m_impl->start(ep);
}

bool Acceptor::start(const char *ip, unsigned short port)
{
    return start({ip, port});
}

void Acceptor::stop()
{
    m_impl->stop();
}

void Acceptor::update()
{
    m_impl->update();
}